import { Controller, Get, Param, Post, Query, Req, Body } from "@nestjs/common";
import { UsersService } from "./users.service";
import { Request } from 'express';
import { User } from "./user.model";

@Controller('user')
export class UsersController {
  constructor(private readonly usersService: UsersService) {}
  @Get('/findAll') 
  findAll() {
    return this.usersService.findAll()
  }

  @Get('/findOne')
  findOne(@Query('id') id: string) {
    return this.usersService.findOne(id)
  }

  @Post('/addOne')
  addOne(@Body() user: User) {
    return this.usersService.addOne(user)
  }

  @Get('/remove')
  remove(@Query('id') id: string): Promise<void> {
    return this.usersService.remove(id)
  }
}